//拉平数组
let flatArr = function(arr, newarr){
  let i = 0;
  let j = 0;
  arr.forEach(item => {
    if (item.children) {
      //删除空file数组
      // if (item.file) {
        newarr.push({
          id :item.id,
          resources_name :item.resources_name,
          file :item.file,
        });
      flatArr(item.children, newarr)
    }else {
      newarr.push({
        id :item.id,
        resources_name :item.resources_name,
        file :item.file
      })
    }
  })
}
export default flatArr;
